home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Resources / Online / Term / Extras / Source / gtlayout-source.lha / LTP_Atol.c < prev    next >
C/C++ Source or Header  |  1996-03-18  |  438b  |  32 lines

  1. /*
  2. **    GadTools layout toolkit
  3. **
  4. **    Copyright © 1993-1996 by Olaf `Olsen' Barthel
  5. **        Freely distributable.
  6. **
  7. **    :ts=4
  8. */
  9.  
  10. #ifndef _GTLAYOUT_GLOBAL_H
  11. #include "gtlayout_global.h"
  12. #endif
  13.  
  14. ULONG
  15. LTP_Atol(STRPTR String)
  16. {
  17.     ULONG Value = 0;
  18.  
  19.     while(*String == ' ' || *String == '\t')
  20.         String++;
  21.  
  22.     while(*String)
  23.     {
  24.         if(*String >= '0' && *String <= '9')
  25.             Value = (Value * 10) + ((*String++) - '0');
  26.         else
  27.             break;
  28.     }
  29.  
  30.     return(Value);
  31. }
  32.